package net.comm.blog.web.form;

import net.comm.page.PageCtr;

import org.apache.struts.action.*;
import org.apache.struts.upload.FormFile;

public class BlogForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private static final String KEY_SPLIT = "#,##,#,#,#";
	
	private int QryUserID;
	private String QryContent;
	private int QryBlogID;
	private int QryFollID;
	private int QryUpFollID;	//	评论ID
	private String QryOrderby;

	private int BlogID;		//	博客ID
	private int FollID;		//	评论ID
	private int UpFollID;	//	评论ID
	private String Title;	//	博客标题
	private String Intro;	//	内容简介
	private String Content;	//	内容
	private String Tags;	//	关键词
	private int F_ID;		//	附件ID
	private String PubTime;	//	发布时间
	private int UserID;		//	用户ID
	private int UpUserID;	//	用户ID
	private int AttachNum;	//	浏览次数
	private int ReplyNum;	//	评论次数
	private int Firsort;	//	分类一
	private int Secsort;	//	分类二
	private int Thisort;	//	分类三
	private String ReplyFlg;//	是否允许评论
	private String BlogSet;	//	隐私保护
	private String Status;	//	状态
	private String Mtime;	//	最后修改日期
	
	private FormFile  Filepath;		//
	

	public BlogForm() {
		super();
		// TODO Auto-generated constructor stub
		Clear();
	}
	public void Clear() {
		
		QryUserID = 0;
		QryContent = "";
		QryBlogID = 0;
		QryFollID = 0;
		QryUpFollID = 0;
		QryOrderby = "";
		
		BlogID = 0;		//博客ID
		FollID = 0;		//	评论ID
		UpFollID = 0;
		Title = "";	//	博客标题
		Intro = "";	//	内容简介
		Content = "";	//	内容
		Tags = "";	//	关键词
		F_ID = 0;		//	附件ID
		PubTime = "";	//	发布时间
		UserID = 0;		//	用户ID
		UpUserID = 0;
		AttachNum = 0;	//	浏览次数
		ReplyNum = 0;	//	评论次数
		Firsort = 0;	//	分类一
		Secsort = 0;	//	分类二
		Thisort = 0;	//	分类三
		ReplyFlg = "";	//	是否允许评论
		BlogSet = "";
		Status = "";	//	状态
		Mtime = "";	//	最后修改日期	
		Filepath = null;
	}

	/**
	 * 查询当前页主键值串
	 */
	private String key = "";

	/**
	 * 查询上上页主键值串
	 */
	private String lastKey = "";
	

	/**
	 * 分页控制对象
	 */
	private PageCtr page;
	


	private String action = "";

	public PageCtr getPage() {
		return page;
	}

	public void setPage(PageCtr page) {
		this.page = page;
	}
	
	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String[] array) {
		if(key != null && key.trim().length() > 0) {
			key = "";
		}
		
		StringBuffer keyBuff = new StringBuffer();
		for (int i = 0; i < array.length; i++) 
		{
			/**
			 * 防止空字符串引起的split方法异常
			 */
			if(array[i] == null || array[i].length() == 0) {
				keyBuff.append(" ");
			} else {
				keyBuff.append(array[i]);
			}
			
			keyBuff.append(KEY_SPLIT);
		}
		
		key = keyBuff.toString();		
	}
	
	/**
	 * 获取lastKey值
	 * @return
	 */
	public String[] lastKey()
	{
		if(lastKey == null || lastKey.trim().length() == 0) {
			return null;
		}
		
		return lastKey.split(KEY_SPLIT);
	}
	
	public String getLastKey() {
		return lastKey;
	}

	public void setLastKey(String lastKey) {
		this.lastKey = lastKey;
	}

	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}
	
	public static String getKEY_SPLIT() {
		return KEY_SPLIT;
	}


	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public int getQryUserID() {
		return QryUserID;
	}
	public String getQryContent() {
		return QryContent;
	}
	public int getQryBlogID() {
		return QryBlogID;
	}

	public String getQryOrderby() {
		return QryOrderby;
	}
	public int getBlogID() {
		return BlogID;
	}
	public int getFollID() {
		return FollID;
	}
	public String getTitle() {
		return Title;
	}
	public String getIntro() {
		return Intro;
	}
	public String getContent() {
		return Content;
	}
	public String getTags() {
		return Tags;
	}
	public int getF_ID() {
		return F_ID;
	}
	public String getPubTime() {
		return PubTime;
	}
	public int getUserID() {
		return UserID;
	}

	public int getAttachNum() {
		return AttachNum;
	}
	public int getReplyNum() {
		return ReplyNum;
	}
	public int getFirsort() {
		return Firsort;
	}
	public int getSecsort() {
		return Secsort;
	}
	public int getThisort() {
		return Thisort;
	}
	public String getReplyFlg() {
		return ReplyFlg;
	}
	public String getStatus() {
		return Status;
	}
	public String getMtime() {
		return Mtime;
	}

	public void setQryUserID(int qryUserID) {
		QryUserID = qryUserID;
	}
	public void setQryContent(String qryContent) {
		QryContent = qryContent;
	}
	public void setQryBlogID(int qryBlogID) {
		QryBlogID = qryBlogID;
	}

	public void setQryOrderby(String qryOrderby) {
		QryOrderby = qryOrderby;
	}
	public void setBlogID(int blogID) {
		BlogID = blogID;
	}
	public void setFollID(int follID) {
		FollID = follID;
	}

	public void setTitle(String title) {
		Title = title;
	}
	public void setIntro(String intro) {
		Intro = intro;
	}
	public void setContent(String content) {
		Content = content;
	}
	public void setTags(String tags) {
		Tags = tags;
	}
	public void setF_ID(int f_id) {
		F_ID = f_id;
	}
	public void setPubTime(String pubTime) {
		PubTime = pubTime;
	}
	public void setUserID(int userID) {
		UserID = userID;
	}

	public void setAttachNum(int attachNum) {
		AttachNum = attachNum;
	}
	public void setReplyNum(int replyNum) {
		ReplyNum = replyNum;
	}
	public void setFirsort(int firsort) {
		Firsort = firsort;
	}
	public void setSecsort(int secsort) {
		Secsort = secsort;
	}
	public void setThisort(int thisort) {
		Thisort = thisort;
	}
	public void setReplyFlg(String replyFlg) {
		ReplyFlg = replyFlg;
	}
	public void setStatus(String status) {
		Status = status;
	}
	public void setMtime(String mtime) {
		Mtime = mtime;
	}
	public FormFile getFilepath() {
		return Filepath;
	}
	public void setFilepath(FormFile filepath) {
		Filepath = filepath;
	}
	public int getUpFollID() {
		return UpFollID;
	}
	public int getUpUserID() {
		return UpUserID;
	}
	public void setUpFollID(int upFollID) {
		UpFollID = upFollID;
	}
	public void setUpUserID(int upUserID) {
		UpUserID = upUserID;
	}
	public String getBlogSet() {
		return BlogSet;
	}
	public void setBlogSet(String blogSet) {
		BlogSet = blogSet;
	}
	public int getQryFollID() {
		return QryFollID;
	}
	public int getQryUpFollID() {
		return QryUpFollID;
	}
	public void setQryFollID(int qryFollID) {
		QryFollID = qryFollID;
	}
	public void setQryUpFollID(int qryUpFollID) {
		QryUpFollID = qryUpFollID;
	}


	
}